package TH;

import java.awt.*;
import javax.swing.*;
import javax.swing.JFrame;
import java.awt.event.*;

public class TH extends JFrame {
	TextField txtkey = new TextField(25);
	TextArea txtmeans = new TextArea("the key",50, 50);
	TextArea txtareText = new TextArea(30, 25);
	JButton btnRed = new JButton("Red!");
	JButton btnBlue = new JButton("Blue!");
	JButton bttexit = new JButton("Exit!");
	JButton bttSounds = new JButton("sound"); 
	public TH() {
		// title of supper class JFrame
		super("Dictionary E-V");
		JScrollPane scrollpanel1 = new JScrollPane(txtareText);
		JScrollPane scrollpanel2 = new JScrollPane(txtmeans);
		
		setLayout(new BorderLayout());
		
		//panel1
		JPanel panel1 = new JPanel();
		panel1.setLayout(new BorderLayout());
		panel1.add( txtkey, BorderLayout.NORTH);
		panel1.add(scrollpanel1, BorderLayout.CENTER);
		//panel1.add(txtareText, BorderLayout.SOUTH);
		add(panel1, BorderLayout.WEST);
		
		//panel 3
		JPanel panel3 = new JPanel();
		panel3.add(scrollpanel2);
		add(panel3, BorderLayout.CENTER);
		// panel2
		JPanel panel2 = new JPanel();
		JPanel panel21 = new JPanel();
		panel2.setLayout(new BorderLayout());
		//panel21 container by panel2
		panel21.add(bttexit);
		panel21.add(btnRed);
		panel21.add(btnBlue);
		panel21.add(bttSounds);
		panel2.add(panel21, BorderLayout.EAST);
		add(panel2, BorderLayout.SOUTH);
		
		this.setSize(600,700);
		this.setVisible(true);
		addWindowListener(new WindowAdapter() {
		    public void windowClosing(WindowEvent we) {
			setVisible(false);
			System.exit(0);
				}
			});
	}

	public static void main(String args[]) {
		 new TH();
	}

}
